package org.huang.spock.spring.param.exception;

import lombok.Getter;

public class BizException  extends RuntimeException {

    @Getter
    private Integer code;
    @Getter
    private String message;

    public BizException(String message) {
        super(message);
        this.code = 500;
        this.message = message;
    }

    public BizException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message  = message;
    }

    public BizException(String message, Throwable cause) {
        super(message, cause);
        this.code = 500;
        this.message = message;
    }

    public BizException(Throwable cause) {
        super(cause);
        this.code = 500;
        this.message = "Error!!!";
    }

    protected BizException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.code = 500;
        this.message = message;
    }
}
